package com.doit.demo05;


import java.io.FileReader;
import java.io.IOException;
import java.io.Reader;

public class test_read {
    public static void main(String[] args) throws IOException {
        Reader r = new FileReader("d:\\work\\abc\\1.txt");

//        int data = 0;
//        while((data = r.read())!=-1)
//        {
//            System.out.print((char) data);
//        }

        int len = 0 ;
        char[] chars = new char[1024];

        while ((len=r.read(chars))!=-1){
            System.out.println(new  String(chars,0,len));
        }
        r.close();
    }
}
